package com.example.springboot.controller;

import com.example.springboot.pojo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @outhor fufeixiang
 * @date 2021-11-16
 */
@RestController
@RequestMapping("/user")
public class UserController {
    //用户登录
    @PostMapping("/login")
    private R login(){
        return R.ok().data("token",1);
    }
    //用户登录成功后的用户信息
    @GetMapping("/info")
    public R getInfo(){
        return R.ok().data("username","admin").data("avator","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");

    }
    //用户登出（注销）
    @GetMapping("/logout")
    public R logout(){
        return R.ok();
    }
}
